﻿using System;
using System.Collections;
using System.Collections.Generic;
using com.guojin.mj.net.message.game;
using UnityEngine;
using UnityEngine.UI;

public class GameEndItemPage : EventManager
{
    public Text name;
    public Text takeInScore;
    public Text settleScore;

    public override void InformationSetting()
    {

    }

    public void InitGameEndItem(DissolveRoomPlayerInfo dr) 
    {
        if (dr.userId.ToString() == GameData.GetInstance().userID)
        {
            SetTextSelect(name);
            SetTextSelect(takeInScore);
            SetTextSelect(settleScore);
            SetText(name, dr.name);
            SetText(takeInScore, dr.takeInScore.ToString());
            if (dr.settleScore > 0)
            {
                SetText(settleScore, "+" + dr.settleScore.ToString());
            }
            else
            {
                SetText(settleScore, dr.settleScore.ToString());
            }      
        }
        else
        {
            SetText(name, dr.name);
            SetText(takeInScore, dr.takeInScore.ToString());
            if (dr.settleScore > 0)
            {
                SetText(settleScore, "+" + dr.settleScore.ToString());
            }
            else
            {
                SetText(settleScore, dr.settleScore.ToString());
            }
        }
    }
}
